package com.itheima.zxy;

import javax.swing.*;
import java.awt.*;

public class demo02 {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setSize(400, 300);
        jf.setLocationRelativeTo(null);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 20));

        for (int i = 0; i < 10; i++) {
            JButton btn = new JButton("btn" + i);
            jf.add(btn);
        }
        jf.setVisible(true);
    }
}
